<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="#(root)assets/element-ui/lib/theme-chalk/index.css">
<title>在线用户</title>
</head>
<body>
	<div id="app">
		<div style="background-color: white; padding: 15px;">
			<el-form ref="form" :model="form" size="mini" label-width="80px">
				
			</el-form>
			<el-table :data="list" size="mini" style="width: 100%">
				
			</el-table>
			<el-pagination background :current-page="form.page" @current-change="gopage" layout="prev, pager, next" prev-text="上一页" next-text="下一页" :total="count"></el-pagination>
		</div>
	</div>
	<!-- 引入组件 -->
	<!-- 先引入 Vue -->
	<script src="#(root)assets/vue/vue.js"></script>
	<script src="#(root)assets/vue/vue-router.min.js"></script>
	<script src="#(root)assets/vue/axios.min.js"></script>
	<script src="#(root)assets/jquery/jquery2.js"></script>
	<script src="#(root)assets/layer/layer.js"></script>
	<script src="#(root)assets/lay/excel.js"></script>
	<!-- 引入组件库 -->
	<script src="#(root)assets/element-ui/lib/index.js"></script>

	<script>
	var url="list"
	var Vue = window.Vue;
	var ElementUI = window.ELEMENT;
  	Vue.use(ElementUI);
	new Vue({
	el:"#app",
	data:{
		form:{
			page:1,
			limit:20,
		},
		list:[],
		count:0
	},
	created(){
		var _this=this;
        axios.post(url,_this.form)
        .then(function (response) {
          _this.list=response.data.data;
          _this.count=response.data.count;
        })
        .catch(function (error) {
          console.log(error);
        });
	},
	methods:{
	  gopage(currentpage){
    		var _this=this;
    		this.form.page=currentpage;
    		axios.post(url,_this.form)
            .then(function (response) {
              _this.list=response.data.data;
              _this.count=response.data.count;
            });
		},
	}
})
</script>
</body>
</html>